public class test3 {
    //LCR 006 两数之和 - 输入有效数组
    public static void main(String[] args) {
        int[] numbers = {-1,0};
        int target = -1;
        int[] ret = {-1, -1};
        int min = 0;
        int max = numbers.length - 1;

        while (min < max) {
            if (numbers[min] + numbers[max] > target) {
                max--;
            } else if (numbers[min] + numbers[max] < target) {
                min++;
            } else {
                ret[0] = min;
                ret[1] = max;
                break;

            }

        }
        System.out.println(ret[0]);
        System.out.println(ret[1]);

    }
}
